Searching one or more documents for several different strings may be performed using different kinds of algorithm, such as Boyer-Moore. Examples of search constraints can include the following constraints:
The strings are fixed, but of differing lengths.
The matcher runs the search in a streaming environment. So it needs to match without buffering large amounts of data.
The matcher has to be efficient by examining as few characters as possible, and copying as few characters into buffers as possible.
A prior solution involves the Boyer-Moore algorithm. However, this algorithm can only be applied when matching a single search string and not several strings. If the strings were all the same size, a rolling hash algorithm could be used. Regular expression matching algorithm would also work too. But the matching operation tends to be slow with the above constraints.